// 全局表格和分页组件样式
// 确保整个系统的表格样式一致性
// 全局表格样式 - 使用Element Plus CSS变量覆盖
.el-table {
    --el-table-border-color: #e8f4f8;
    --el-table-border: 1px solid var(--el-table-border-color);
    --el-table-text-color: #333333;
    --el-table-header-text-color: #ffffff;
    --el-table-row-hover-bg-color: rgba(79, 218, 202, 0.1);
    --el-table-current-row-bg-color: rgba(79, 218, 202, 0.2);
    --el-table-header-bg-color: #16a5b7 !important;
    --el-table-header-height: 36px;
    --el-table-fixed-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --el-table-bg-color: #ffffff;
    --el-table-tr-bg-color: #ffffff;
    --el-table-expanded-cell-bg-color: #fafbfc;
    --el-table-fixed-left-column: inset 10px 0 10px -10px rgba(0, 0, 0, 0.15);
    --el-table-fixed-right-column: inset -10px 0 10px -10px rgba(0, 0, 0, 0.15);
    --el-table-index: 1000;
}

// 全局按钮样式 - 使用Element Plus CSS变量统一主题色，提升优先级
.el-button.el-button--primary.is-link,
.el-button.el-button--primary.is-plain,
.el-button.el-button--primary.is-text,
.el-button.el-button--text {
    --el-button-text-color: #16a5b7 !important;
    --el-button-bg-color: transparent !important;
    --el-button-border-color: transparent !important;
    --el-button-hover-text-color: #ffffff !important;
    --el-button-hover-bg-color: linear-gradient( 135deg, #4fdaca 0%, #32b7cb 100%) !important;
    --el-button-hover-border-color: #16a5b7 !important;
    --el-button-active-text-color: #ffffff !important;
    --el-button-active-bg-color: linear-gradient( 135deg, #32b7cb 0%, #4fdaca 100%) !important;
    --el-button-active-border-color: #16a5b7 !important;
    --el-button-disabled-text-color: #c0c4cc !important;
    --el-button-disabled-bg-color: #f5f7fa !important;
    --el-button-disabled-border-color: #e4e7ed !important;
}

// 主要按钮样式 - 提升优先级
.el-button.el-button--primary {
    --el-button-text-color: #ffffff !important;
    --el-button-bg-color: linear-gradient( 135deg, #16a5b7 0%, #32b7cb 100%) !important;
    --el-button-border-color: #16a5b7 !important;
    --el-button-hover-text-color: #ffffff !important;
    --el-button-hover-bg-color: linear-gradient( 135deg, #32b7cb 0%, #4fdaca 100%) !important;
    --el-button-hover-border-color: #32b7cb !important;
    --el-button-active-text-color: #ffffff !important;
    --el-button-active-bg-color: linear-gradient( 135deg, #2aa3b8 0%, #3bc4b3 100%) !important;
    --el-button-active-border-color: #2aa3b8 !important;
    padding: 8px 16px;
}

// 通用按钮样式 - 提升优先级
.el-button {
    --el-button-text-color: #16a5b7 !important;
    --el-button-bg-color: transparent !important;
    --el-button-border-color: #4fdaca !important;
    --el-button-hover-text-color: #ffffff !important;
    --el-button-hover-bg-color: linear-gradient( 135deg, #4fdaca 0%, #32b7cb 100%) !important;
    --el-button-hover-border-color: #4fdaca !important;
    --el-button-active-text-color: #ffffff !important;
    --el-button-active-bg-color: linear-gradient( 135deg, #32b7cb 0%, #4fdaca 100%) !important;
    --el-button-active-border-color: #32b7cb !important;
    --el-button-disabled-text-color: #c0c4cc !important;
    --el-button-disabled-bg-color: #f5f7fa !important;
    --el-button-disabled-border-color: #e4e7ed !important;
}

// 按钮组样式
.mb8 {
    margin-bottom: 10px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    .el-button {
        border-radius: 6px;
        font-weight: 500;
        &.el-button--primary.is-plain {
            background: linear-gradient(135deg, #4fdaca 0%, #32b7cb 100%);
            border: none;
            color: #ffffff;
            &:hover {
                background: linear-gradient(135deg, #3bc4b3 0%, #2aa3b8 100%);
                color: #ffffff;
            }
        }
    }
}

.el-button--primary {
    background: linear-gradient(135deg, #4fdaca 0%, #32b7cb 100%);
    border: none;
    color: #ffffff;
    &:hover {
        background: linear-gradient(135deg, #3bc4b3 0%, #2aa3b8 100%);
        color: #ffffff;
    }
}

// 表格基础样式
.el-table {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    border: 1px solid #e8f4f8 !important;
    // 表头样式 - 添加渐变效果
    .el-table__header {
        background: linear-gradient(135deg, #4fdaca 0%, #32b7cb 100%) !important;
        height: 36px;
        tr {
            background: transparent !important;
        }
        th {
            background: transparent !important;
            font-weight: 700 !important;
            font-size: 14px !important;
            padding: 10px 12px !important;
            position: relative !important;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
            letter-spacing: 0.5px !important;
            &::after {
                content: "";
                position: absolute;
                right: 0;
                top: 20%;
                height: 60%;
                width: 1px;
                background: rgba(255, 255, 255, 0.4);
            }
            &:last-child::after {
                display: none;
            }
            &:first-child {
                border-radius: 12px 0 0 0 !important;
            }
            &:last-child {
                border-radius: 0 12px 0 0 !important;
            }
        }
    }
    // 表格体样式 - 使用CSS变量，这里只做补充
    .el-table__body {
        tr {
            background: var(--el-table-tr-bg-color) !important;
            transition: all 0.3s ease;
            &:hover {
                transform: translateY(-1px);
                box-shadow: 0 2px 8px rgba(79, 218, 202, 0.15);
            }
            &:nth-child(even) {
                background: #fafbfc !important;
            }
        }
    }
    // 单元格样式
    .el-table__cell {
        border-bottom: 1px solid #f0f2f5;
        padding: 16px 12px;
        font-size: 13px;
        color: #333;
        transition: all 0.3s ease;
    }
    // 行悬停时第一列样式
    .el-table__row:hover .el-table__cell:first-child {
        border-left-color: #4fdaca;
    }
    // 操作按钮列样式
    .el-table__cell:last-child {
        .el-button.el-button--text {
            margin: 0 6px !important;
            padding: 8px 16px !important;
            border-radius: 8px !important;
            font-size: 13px !important;
            font-weight: 600 !important;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
            border: 1px solid transparent !important;
            position: relative !important;
            overflow: hidden !important;
            color: #16a5b7 !important;
            &::before {
                content: "";
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(135deg, #4fdaca 0%, #32b7cb 100%);
                transition: left 0.3s ease;
                z-index: -1;
            }
            &:hover {
                color: #ffffff !important;
                transform: translateY(-2px) !important;
                box-shadow: 0 4px 12px rgba(79, 218, 202, 0.4) !important;
                border-color: #4fdaca !important;
                background: transparent !important;
                &::before {
                    left: 0;
                }
            }
            &:active {
                transform: translateY(0) !important;
                box-shadow: 0 2px 6px rgba(79, 218, 202, 0.3) !important;
            }
        }
    }
}

// 全局分页组件样式 - 简化版
.el-pagination {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 5px !important;
    padding: 8px 12px !important;
    background: #fff !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    border: none !important;
    // 分页器按钮样式 - 简化版
    .el-pager {
        li {
            border-radius: 4px !important;
            border: 1px solid #e8f4f8 !important;
            margin: 0 2px !important;
            min-width: 28px !important;
            height: 28px !important;
            line-height: 26px !important;
            text-align: center !important;
            font-size: 12px !important;
            font-weight: 500 !important;
            color: #666 !important;
            background: #ffffff !important;
            transition: all 0.2s ease !important;
            &:hover {
                color: #4fdaca !important;
                border-color: #4fdaca !important;
                background: linear-gradient( 135deg, rgba(79, 218, 202, 0.1) 0%, rgba(50, 183, 203, 0.1) 100%) !important;
                transform: translateY(-1px) !important;
                box-shadow: 0 2px 8px rgba(79, 218, 202, 0.2) !important;
            }
            &.is-active {
                color: #ffffff !important;
                background: linear-gradient( 135deg, #4fdaca 0%, #32b7cb 100%) !important;
                border-color: #4fdaca !important;
                box-shadow: 0 2px 8px rgba(79, 218, 202, 0.3) !important;
                transform: translateY(-1px) !important;
            }
        }
    }
    // 上一页下一页按钮样式 - 简化版
    .btn-prev,
    .btn-next {
        border-radius: 4px !important;
        border: 1px solid #e8f4f8 !important;
        margin: 0 2px !important;
        min-width: 28px !important;
        height: 28px !important;
        line-height: 26px !important;
        text-align: center !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #666 !important;
        background: #ffffff !important;
        transition: all 0.2s ease !important;
        &:hover {
            color: #4fdaca !important;
            border-color: #4fdaca !important;
            background: linear-gradient( 135deg, rgba(79, 218, 202, 0.1) 0%, rgba(50, 183, 203, 0.1) 100%) !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 2px 8px rgba(79, 218, 202, 0.2) !important;
        }
        &:disabled {
            color: #c0c4cc !important;
            background: #f5f7fa !important;
            border-color: #e4e7ed !important;
            cursor: not-allowed !important;
            &:hover {
                transform: none !important;
                box-shadow: none !important;
            }
        }
    }
    // 跳转输入框样式
    .el-pagination__jump {
        color: #666 !important;
        font-size: 13px !important;
        .el-input {
            .el-input__wrapper {
                border-radius: 6px !important;
                border: 1px solid #e8f4f8 !important;
                width: 50px !important;
                height: 32px !important;
                &:hover {
                    border-color: #4fdaca !important;
                }
                &.is-focus {
                    border-color: #4fdaca !important;
                    box-shadow: 0 0 0 2px rgba(79, 218, 202, 0.2) !important;
                }
            }
        }
    }
    // 每页显示数量选择器样式
    .el-pagination__sizes {
        .el-select {
            .el-select__wrapper {
                border-radius: 6px !important;
                border: 1px solid #e8f4f8 !important;
                height: 32px !important;
                &:hover {
                    border-color: #4fdaca !important;
                }
                &.is-focus {
                    border-color: #4fdaca !important;
                    box-shadow: 0 0 0 2px rgba(79, 218, 202, 0.2) !important;
                }
            }
        }
    }
    // 总数显示样式 - 简化版
    .el-pagination__total {
        color: #666 !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        margin-right: 8px !important;
    }
}

// 全局操作按钮样式
.el-button--text {
    color: #16a5b7 !important;
    font-weight: 600 !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    &:hover {
        color: #32b7cb !important;
        background: linear-gradient( 135deg, rgba(79, 218, 202, 0.1) 0%, rgba(50, 183, 203, 0.1) 100%) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 8px rgba(79, 218, 202, 0.2) !important;
    }
    &:active {
        transform: translateY(0) !important;
        box-shadow: 0 1px 4px rgba(79, 218, 202, 0.3) !important;
    }
}

// 对话框样式 - 使用系统主颜色，减少空白区域
.el-dialog {
    border-radius: 12px !important;
    margin: 5vh auto !important; // 减少上下边距
    max-height: 90vh !important; // 限制最大高度
    padding: 0 !important;
    .el-dialog__header {
        background: linear-gradient(135deg, #16a5b7 0%, #32b7cb 100%) !important;
        color: #ffffff !important;
        padding: 16px 20px !important; // 减少内边距
        border-radius: 12px 12px 0 0 !important;
        position: relative !important;
        .el-dialog__title {
            color: #ffffff !important;
            font-weight: 600 !important;
            font-size: 16px !important;
        }
        .el-dialog__headerbtn {
            position: absolute !important;
            right: 16px !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            width: 32px !important;
            height: 32px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            background: rgba(255, 255, 255, 0.2) !important;
            border-radius: 50% !important;
            transition: all 0.3s ease !important;
            &:hover {
                background: rgba(255, 255, 255, 0.3) !important;
                transform: translateY(-50%) scale(1.1) !important;
            }
            .el-dialog__close {
                color: #ffffff !important;
                font-size: 18px !important;
                font-weight: bold !important;
                line-height: 1 !important;
                &:hover {
                    color: #ffffff !important;
                }
            }
        }
    }
    .el-dialog__body {
        padding: 0px !important; // 减少内边距
        max-height: calc(90vh - 120px) !important; // 限制内容区域高度
        overflow-y: auto !important; // 内容过多时滚动
    }
    .el-dialog__footer {
        padding: 12px 20px 16px !important; // 减少内边距
        text-align: right !important;
        background: #f8f9fa !important;
        border-radius: 0 0 12px 12px !important;
        border-top: 1px solid #e8f4f8 !important;
        .el-button {
            font-weight: 600 !important;
            margin-left: 8px !important;
            &.el-button--primary {
                background: linear-gradient( 135deg, #16a5b7 0%, #32b7cb 100%) !important;
                border-color: #16a5b7 !important;
                color: #ffffff !important;
                &:hover {
                    background: linear-gradient( 135deg, #32b7cb 0%, #16a5b7 100%) !important;
                    border-color: #32b7cb !important;
                }
            }
            &:not(.el-button--primary) {
                color: #666666 !important;
                background: #ffffff !important;
                border-color: #dcdfe6 !important;
                &:hover {
                    color: #16a5b7 !important;
                    border-color: #16a5b7 !important;
                    background: rgba(22, 165, 183, 0.05) !important;
                }
            }
        }
    }
}

// 确认对话框样式 - 使用系统主颜色，减少空白区域
.el-message-box {
    border-radius: 12px !important;
    margin: 10vh auto !important; // 减少上下边距
    max-width: 400px !important; // 限制最大宽度
    .el-message-box__header {
        padding: 16px 20px 8px !important; // 减少内边距
        .el-message-box__title {
            color: #333 !important;
            font-weight: 600 !important;
            font-size: 16px !important;
        }
    }
    .el-message-box__content {
        color: #666 !important;
        padding: 8px 20px 16px !important; // 减少内边距
    }
    .el-message-box__btns {
        padding: 8px 20px 16px !important; // 减少内边距
        text-align: right !important;
        .el-button {
            border-radius: 6px !important;
            font-weight: 600 !important;
            margin-left: 8px !important;
            &.el-button--primary {
                background: linear-gradient( 135deg, #16a5b7 0%, #32b7cb 100%) !important;
                border-color: #16a5b7 !important;
                color: #ffffff !important;
                &:hover {
                    background: linear-gradient( 135deg, #32b7cb 0%, #16a5b7 100%) !important;
                    border-color: #32b7cb !important;
                }
            }
            &:not(.el-button--primary) {
                color: #666666 !important;
                background: #ffffff !important;
                border-color: #dcdfe6 !important;
                &:hover {
                    color: #16a5b7 !important;
                    border-color: #16a5b7 !important;
                    background: rgba(22, 165, 183, 0.05) !important;
                }
            }
        }
    }
}

// 全局表单样式
.el-form {
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    .el-form-item {
        margin-bottom: 20px !important;
        .el-form-item__label {
            color: #333333 !important;
            font-weight: 500 !important;
            font-size: 14px !important;
        }
        .el-form-item__content {
            .el-form-item__error {
                color: #f56c6c !important;
                font-size: 12px !important;
                margin-top: 4px !important;
            }
        }
    }
}

// 全局输入框样式
.el-input {
    .el-input__wrapper {
        border-radius: 6px !important;
        border: 1px solid #dcdfe6 !important;
        transition: all 0.3s ease !important;
        &:hover {
            border-color: #16a5b7 !important;
        }
        &.is-focus {
            border-color: #16a5b7 !important;
            box-shadow: 0 0 0 2px rgba(22, 165, 183, 0.2) !important;
        }
    }
    .el-input__inner {
        color: #333333 !important;
        font-size: 14px !important;
        &::placeholder {
            color: #c0c4cc !important;
        }
    }
}

// 全局选择器样式
.el-select {
    .el-select__wrapper {
        border-radius: 6px !important;
        border: 1px solid #dcdfe6 !important;
        transition: all 0.3s ease !important;
        &:hover {
            border-color: #16a5b7 !important;
        }
        &.is-focused {
            border-color: #16a5b7 !important;
            box-shadow: 0 0 0 2px rgba(22, 165, 183, 0.2) !important;
        }
    }
    .el-select__placeholder {
        color: #c0c4cc !important;
        font-size: 14px !important;
    }
    .el-select__selected-item {
        color: #333333 !important;
        font-size: 14px !important;
    }
}

// 全局数字输入框样式
.el-input-number {
    .el-input__wrapper {
        border-radius: 6px !important;
        border: 1px solid #dcdfe6 !important;
        transition: all 0.3s ease !important;
        &:hover {
            border-color: #16a5b7 !important;
        }
        &.is-focus {
            border-color: #16a5b7 !important;
            box-shadow: 0 0 0 2px rgba(22, 165, 183, 0.2) !important;
        }
    }
    .el-input-number__increase,
    .el-input-number__decrease {
        color: #16a5b7 !important;
        &:hover {
            color: #32b7cb !important;
        }
    }
}

// 全局文本域样式
.el-textarea {
    .el-textarea__inner {
        border-radius: 6px !important;
        border: 1px solid #dcdfe6 !important;
        transition: all 0.3s ease !important;
        color: #333333 !important;
        font-size: 14px !important;
        &:hover {
            border-color: #16a5b7 !important;
        }
        &:focus {
            border-color: #16a5b7 !important;
            box-shadow: 0 0 0 2px rgba(22, 165, 183, 0.2) !important;
        }
        &::placeholder {
            color: #c0c4cc !important;
        }
    }
}

// 全局单选框组样式
.el-radio-group {
    .el-radio {
        .el-radio__input {
            &.is-checked {
                .el-radio__inner {
                    background-color: #16a5b7 !important;
                    border-color: #16a5b7 !important;
                }
            }
        }
        .el-radio__label {
            color: #333333 !important;
            font-size: 14px !important;
        }
    }
}

// 全局复选框组样式
.el-checkbox-group {
    .el-checkbox {
        .el-checkbox__input {
            &.is-checked {
                .el-checkbox__inner {
                    background-color: #16a5b7 !important;
                    border-color: #16a5b7 !important;
                }
            }
        }
        .el-checkbox__label {
            color: #333333 !important;
            font-size: 14px !important;
        }
    }
}